/*
package org.itboys.core.controller.web;

import org.itboys.commons.CommonConstants;
import org.itboys.commons.dto.ResultPageDOHelper;
import org.itboys.commons.utils.ajax.AjaxUtils;
import org.itboys.core.entity.mongo.SundayKnowledgeBase;
import org.itboys.core.service.mongo.web.SundayKnowledgeBaseService;
import org.itboys.core.util.ResponseMessage;
import org.itboys.framework.query.JsonPageUtils;
import org.itboys.framework.spring.controller.BaseController;
import org.itboys.param.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


*/
/**
 * Auther: 罗尧坤
 * Date: 2018/8/2
 * Description:知识库controller
 *//*


@Controller
@RequestMapping("/sunday/web/knowledgeBase")
public class SundayKnowledgeBaseController extends BaseController {
    @Autowired
    private SundayKnowledgeBaseService knowledgeBaseService;


*/
/**
     * 知识库首页
     *
     * @return
     *//*


    @RequestMapping("/index")
    public String index() {
        return "/sunday/knowledgeBase/index";
    }

    @RequestMapping("/select")
    public void select(HttpServletRequest request,
                       HttpServletResponse response
    ) {
        try {
            PageResult<SundayKnowledgeBase> result = knowledgeBaseService.select(request);
            JsonPageUtils.renderJsonPage(result.getTotal(), result.getData(), response);

        } catch (Exception e) {
            String msg = "";
            if (e.getClass().getSimpleName().equalsIgnoreCase("ErrorException")) {
                msg = e.getMessage();
            } else {
                msg = CommonConstants.ERROMSG;
                logger.error("/sunday/web/knowledgeBase/select------" + e.getMessage());
            }
            e.printStackTrace();
            ResponseMessage.error(CommonConstants.FAIL_CODE, CommonConstants.FAIL);
        }
    }


*/
/**
     * 修改或新增页面
     *
     * @param request
     * @param response
     * @param id
     * @param model
     * @return
     *//*


    @RequestMapping("/input")
    public String input(HttpServletRequest request,
                        HttpServletResponse response,
                        @RequestParam(value = "id", required = true) Long id,
                        Model model
    ) {
        SundayKnowledgeBase knowledgeBase = knowledgeBaseService.findOne(id);
        model.addAttribute("knowledgeBase", knowledgeBase);
        return "/sunday/knowledgeBase/input";
    }

    @RequestMapping("/save")
    public void save(HttpServletRequest request,
                     HttpServletResponse response,
                     @ModelAttribute SundayKnowledgeBase knowledgeBase
    ) {
        try {
            knowledgeBaseService.save(knowledgeBase);
            ResponseMessage.success();
        } catch (Exception e) {
            e.printStackTrace();
            String msg = " ";
            if (e.getClass().getSimpleName().equalsIgnoreCase("Error Exception")) {
                msg = e.getMessage();
            } else {
                msg = CommonConstants.ERROMSG;
                logger.error("/sunday/web/knowledgeBase/save------" + e.getMessage());
            }
            e.printStackTrace();
            ResponseMessage.error(CommonConstants.FAIL_CODE, CommonConstants.FAIL);
        }
    }


*/
/**
     * 删除某个知识库
     *
     * @param request
     * @param response
     * @param id
     *//*


    @RequestMapping("/delete")
    public void delete(HttpServletRequest request,
                       HttpServletResponse response,
                       @RequestParam(value = "id", required = true) Long id

    ) {
        try {
            knowledgeBaseService.delete(id);
            AjaxUtils.renderJsonporJson(response, null,
                    ResultPageDOHelper.getMsgCodeResultDO(CommonConstants.SUCCESS_CODE, CommonConstants.SUCCESS));
        } catch (Exception e) {

            String msg = "";
            if (e.getClass().getSimpleName().equalsIgnoreCase("ErroException")) {
                msg = e.getMessage();
            } else {
                msg = CommonConstants.ERROMSG;
                logger.error("/sunday/web/knowledgeBase/delete------" + e.getMessage());
            }
            e.printStackTrace();

            AjaxUtils.renderJsonporJson(response, null,
                    ResultPageDOHelper.getMsgCodeResultDO(CommonConstants.FAIL_CODE, CommonConstants.FAIL));
        }
    }

    @RequestMapping("/setStatus")
    public void setStatus(HttpServletRequest request,
                          HttpServletResponse response,
                          @RequestParam(value = "id", required = true) Long id,
                          @RequestParam(value = "status", required = true) Integer status
    ) {
        try {
            knowledgeBaseService.setStatus(id, status);
            AjaxUtils.renderJsonporJson(response, null,
                    ResultPageDOHelper.getMsgCodeResultDO(CommonConstants.SUCCESS_CODE, CommonConstants.SUCCESS));
        } catch (Exception e) {
            String msg = "";
            if (e.getClass().getSimpleName().equalsIgnoreCase("ErroException")) {
                msg = e.getMessage();
            } else {
                msg = CommonConstants.ERROMSG;
                logger.error("/sunday/web/knowledgeBase/setStatus------" + e.getMessage());
            }
            e.printStackTrace();

            AjaxUtils.renderJsonporJson(response, null,
                    ResultPageDOHelper.getMsgCodeResultDO(CommonConstants.FAIL_CODE, CommonConstants.FAIL));
        }
    }

}
*/
